package com.scuec.tourismwebsite.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.scuec.tourismwebsite.entity.WeatherTourism;
import com.scuec.tourismwebsite.mapper.WeatherTourismMapper;
import com.scuec.tourismwebsite.vo.ViewWeatherTourism;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WeatherTourismServiceImpl implements WeatherTourismService{


    private WeatherTourismMapper weatherTourismMapper;

    public WeatherTourismServiceImpl(WeatherTourismMapper weatherTourismMapper) {
        this.weatherTourismMapper = weatherTourismMapper;
    }


    @Override
    public PageInfo<ViewWeatherTourism> findWeatherTourismPages(Integer pageNum, Integer pageSize) {
            PageHelper.startPage(pageNum,pageSize);
            List<ViewWeatherTourism> lists=weatherTourismMapper.findViewWeatherTourism();
            PageInfo<ViewWeatherTourism> pageInfo=new PageInfo<>(lists);
            return pageInfo;
    }

    @Override
    public List<ViewWeatherTourism> findViewWeatherTourism() {

        return weatherTourismMapper.findViewWeatherTourism();
    }

    @Override
    public Integer insertWeatherTourism(WeatherTourism weatherTourism) {
        return weatherTourismMapper.insertWeatherTourism(weatherTourism);
    }

    @Override
    public Integer updateWeatherTourism(WeatherTourism weatherTourism) {
        return weatherTourismMapper.updateWeatherTourism(weatherTourism);
    }

    @Override
    public Integer deleteWeatherTourism(Integer idweather_tourism) {
        return weatherTourismMapper.deleteWeatherTourism(idweather_tourism);
    }
}
